<#compress>


<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,  user-scalable=0;" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style"  />
    <meta content="telephone=no" name="format-detection" />
    <link rel="stylesheet" href="${ctx}/static/mobileweb/1/css/common_gift.css?_=${.now?string}">
    <title>礼品明细</title>
</head>
<body class="graybg">
<div class="giftName">${gift.name!}</div>
<div class="midcontent">
    <div class="animateBox giftshow">
        <div id="productshow">
            <div class="focusWarp">
                <ul class="imgList">
                    <#if gift.picture??>
                        <#list gift.picture?split(',') as p>
                        <li><img src="${ctx}/${p}" class="wdh100"/><p class="desc">活动时间：${gift.begin_time?string('yyyy-MM-dd')}至${gift.end_time?string('yyyy-MM-dd')}</p></li>
                        </#list>
                    <#else>
                        <li><img src="${ctx}/static/mobileweb/images/no_img.png" class="wdh100"/><p class="desc">活动时间：${gift.begin_time?string('yyyy-MM-dd')}至${gift.end_time?string('yyyy-MM-dd')}</p></li>
                    </#if>
                </ul>
            </div>
        </div>
    </div>
    <ul class="descBox">
        <li>
            <#if member.surplus lt gift.intergral>
                <a href="javascript:void(0);" style="background: #998f8e" class="exchangebtn fr" data-id="${gift.id!}" data-mid="${mid!}" data-wxno="${wxno!}">积分不足</a>
            <#else>
                <a href="javascript:void(0);" class="exchangebtn fr" id="exchange_btn" data-id="${gift.id!}" data-mid="${mid!}" data-wxno="${wxno!}">立即兑换</a>
            </#if>

            <span class="points"><img src="${ctx}/static/mobileweb/1/images/score.png" class="vermiddle"/><em>${gift.intergral!}</em>积分</span>
        </li>
        <#--<li>
            <a href="#" class="fr mr20">完善信息</a>
            <span>请完善个人信息</span>
        </li>-->
        <li>
            <h3 class="itemTitle">礼品描述</h3>
            <p class="itemdesc">${gift.description!}</p>
        </li>
    </ul>

    <div class="descBox descArea">
        <h3 class="itemTitle">活动规则</h3>
        <p class="itemdesc">${gift.activity_rule!}</p>
    </div>

    <div class="descBox descArea">
        <h3 class="itemTitle">兑换说明</h3>
        <p class="itemdesc">${gift.explanation!}</p>
    </div>
</div>


</body>


<script type="text/javascript" src="${ctx}/static/mobileweb/scripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${ctx}/static/mobileweb/scripts/easing.js"></script>
<script type="text/javascript" src="${ctx}/static/mobileweb/scripts/MogFocus.js"></script>

<script type="text/javascript" src="${ctx}/static/mobileweb/scripts/noty/jquery.noty.min.js"></script>

<script type="text/javascript">
    document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
        WeixinJSBridge.call('hideToolbar');
    });

    var showMesage = function (text) {
        noty({
            text        : text,
            type        : 'warning',
            dismissQueue: true,
            timeout     : 1000,
            layout      : 'topCenter',
            theme       : 'defaultTheme',
            maxVisible  : 10
        })
    };

    $(function(){
        var win =$(window).width();
        $("#productshow").mogFocus({
            loadAnimation : false,
            time : 3000,
            scrollWidth : win-24,
            animationWay : 'fade',//fade
            prevNextToggle : 'toggle',
            btnStyle : 'noNumber',
            randomsImgTime : 2000,
            focusTime : {duration: 1300, easing: "easeOutBounce"},
            focusTwoTime : {duration: 1300, easing: "easeOutBounce"}
        });

        $('#exchange_btn').click(function() {
            var $this = $(this);
            var id = $this.attr('data-id');
            var mid = $this.attr('data-mid');
            var wxno = $this.attr('data-wxno');

            var url = '${ctx}/mobileweb/exchange/' + id;
            var param = {mid : mid, wxno : wxno};

            $.post(url, param , function(rets) {
                if (rets.status == 'OK') {
                    window.location.href = "${ctx}/mobileweb/exchange/ok?mid="+mid+"&wxno="+wxno;
                } else {
                    showMesage(rets.message);
                }
            });
        });
    });
</script>

</html>

</#compress>